{% extends 'mathtesthome.html' %}
{% block body %}
<div class="main-content container">


    <div class="row">

        <div class="col-sm-12">
            <div class="panel panel-default panel-table">
                <div class="panel-heading panel-heading-divider">{{title}}<span
                        class="panel-subtitle">本次测试得分: {{test.score}}</span>
                    <span
                            class="panel-subtitle">本次测试耗时: {{test.complete_time}}</span>

                </div>
                <div class="panel-body pl-sm-5">
                    <label class="col-12 col-sm-10 col-form-label text-sm-right"><a
                            href="{% url 'mathtest:redomistakewrong' test.id %}">重做错题</a></label>
                </div>

                <div class="panel-body pl-sm-5">

                    <form method='POST' action="{% url 'mathtest:OUtestscore' test.id %}" enctype='multipart/form-data'>
                        {% csrf_token %}

                        {% for q in test.questions.all %}

                        <div class="form-group row ">

                            <label class="col-12 col-sm-3 col-form-label text-sm-right">{{q}}</label>


                            <div class="col-12 col-sm-8 col-lg-6 form-check mt-2">

                                {%for a in q.answer_set.all %}
                                {% if a.id in chooses %}
                                <label class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" name="{{q.id}}"
                                           class="custom-control-input" value="{{a.id}}" required checked> <span
                                        class="custom-control-label">{{a}}</span>
                                </label>
                                {%if a.flag == False %}
                                <label><font color="red">做错</font></label>
                                {%endif%}
                                {%else%}
                                <label class="custom-control custom-radio custom-control-inline">
                                    <input type="radio" name="{{q.id}}"
                                           class="custom-control-input" value="{{a.id}}" required> <span
                                        class="custom-control-label">{{a}}</span>
                                </label>
                                {%endif%}

                                {%endfor%}


                            </div>


                        </div>

                        {%endfor%}


                    </form>

                </div>

            </div>

        </div>


    </div>

</div>


{% endblock %}